home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / AIncludes / AppleEvents.a < prev    next >
Encoding:
Text File  |  1996-01-24  |  26.0 KB  |  938 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        AppleEvents.a
  3. ;
  4. ;    Contains:    AppleEvent Package Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Package:    Universal Interfaces 2.2 in “MPW” on ETO #20
  8. ;
  9. ;    Copyright:    © 1984-1995 by Apple Computer, Inc.
  10. ;                All rights reserved.
  11. ;
  12. ;    Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13. ;                stack.  Include the file and version information (from above)
  14. ;                in the problem description and send to:
  15. ;                    Internet:    apple.bugs@applelink.apple.com
  16. ;                    AppleLink:    APPLE.BUGS
  17. ;
  18. ;
  19.  
  20.     IF &TYPE('__APPLEEVENTS__') = 'UNDEFINED' THEN
  21. __APPLEEVENTS__ SET 1
  22.  
  23.  
  24.     IF &TYPE('__ERRORS__') = 'UNDEFINED' THEN
  25.     include 'Errors.a'
  26.     ENDIF
  27. ;        include 'ConditionalMacros.a'                                ;
  28.  
  29.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  30.     include 'Types.a'
  31.     ENDIF
  32.  
  33.     IF &TYPE('__MEMORY__') = 'UNDEFINED' THEN
  34.     include 'Memory.a'
  35.     ENDIF
  36. ;        include 'MixedMode.a'                                        ;
  37.  
  38.     IF &TYPE('__OSUTILS__') = 'UNDEFINED' THEN
  39.     include 'OSUtils.a'
  40.     ENDIF
  41.  
  42.     IF &TYPE('__EVENTS__') = 'UNDEFINED' THEN
  43.     include 'Events.a'
  44.     ENDIF
  45. ;        include 'Quickdraw.a'                                        ;
  46. ;            include 'QuickdrawText.a'                                ;
  47.  
  48.     IF &TYPE('__EPPC__') = 'UNDEFINED' THEN
  49.     include 'EPPC.a'
  50.     ENDIF
  51. ;        include 'AppleTalk.a'                                        ;
  52. ;        include 'Files.a'                                            ;
  53. ;            include 'Finder.a'                                        ;
  54. ;        include 'PPCToolbox.a'                                        ;
  55. ;        include 'Processes.a'                                        ;
  56.  
  57.     IF &TYPE('__NOTIFICATION__') = 'UNDEFINED' THEN
  58.     include 'Notification.a'
  59.     ENDIF
  60.  
  61. ; Apple event descriptor types 
  62. typeBoolean                        EQU        'bool'
  63. typeChar                        EQU        'TEXT'
  64. typeSMInt                        EQU        'shor'
  65. typeInteger                        EQU        'long'
  66. typeSMFloat                        EQU        'sing'
  67. typeFloat                        EQU        'doub'
  68. typeLongInteger                    EQU        'long'
  69. typeShortInteger                EQU        'shor'
  70. typeLongFloat                    EQU        'doub'
  71. typeShortFloat                    EQU        'sing'
  72. typeExtended                    EQU        'exte'
  73. typeComp                        EQU        'comp'
  74. typeMagnitude                    EQU        'magn'
  75. typeAEList                        EQU        'list'
  76. typeAERecord                    EQU        'reco'
  77. typeAppleEvent                    EQU        'aevt'
  78. typeTrue                        EQU        'true'
  79. typeFalse                        EQU        'fals'
  80. typeAlias                        EQU        'alis'
  81. typeEnumerated                    EQU        'enum'
  82. typeType                        EQU        'type'
  83. typeAppParameters                EQU        'appa'
  84. typeProperty                    EQU        'prop'
  85. typeFSS                            EQU        'fss '
  86. typeKeyword                        EQU        'keyw'
  87. typeSectionH                    EQU        'sect'
  88. typeWildCard                    EQU        '****'
  89. typeApplSignature                EQU        'sign'
  90. typeQDRectangle                    EQU        'qdrt'
  91. typeFixed                        EQU        'fixd'
  92. typeSessionID                    EQU        'ssid'
  93. typeTargetID                    EQU        'targ'
  94. typeProcessSerialNumber            EQU        'psn '
  95. typeNull                        EQU        'null'                ; null or nonexistent data 
  96. ; Keywords for Apple event parameters 
  97. keyDirectObject                    EQU        '----'
  98. keyErrorNumber                    EQU        'errn'
  99. keyErrorString                    EQU        'errs'
  100. keyProcessSerialNumber            EQU        'psn '
  101. ; Keywords for Apple event attributes 
  102. keyTransactionIDAttr            EQU        'tran'
  103. keyReturnIDAttr                    EQU        'rtid'
  104. keyEventClassAttr                EQU        'evcl'
  105. keyEventIDAttr                    EQU        'evid'
  106. keyAddressAttr                    EQU        'addr'
  107. keyOptionalKeywordAttr            EQU        'optk'
  108. keyTimeoutAttr                    EQU        'timo'
  109. keyInteractLevelAttr            EQU        'inte'                ; this attribute is read only - will be set in AESend 
  110. keyEventSourceAttr                EQU        'esrc'                ; this attribute is read only 
  111. keyMissedKeywordAttr            EQU        'miss'                ; this attribute is read only 
  112. keyOriginalAddressAttr            EQU        'from'                ; new in 1.0.1 
  113. ; Keywords for special handlers 
  114. keyPreDispatch                    EQU        'phac'                ; preHandler accessor call 
  115. keySelectProc                    EQU        'selh'                ; more selector call 
  116. ; Keyword for recording 
  117. keyAERecorderCount                EQU        'recr'                ; available only in vers 1.0.1 and greater 
  118. ; Keyword for version information 
  119. keyAEVersion                    EQU        'vers'                ; available only in vers 1.0.1 and greater 
  120. ; Event Class 
  121. kCoreEventClass                    EQU        'aevt'
  122. ; Event ID’s 
  123. kAEOpenApplication                EQU        'oapp'
  124. kAEOpenDocuments                EQU        'odoc'
  125. kAEPrintDocuments                EQU        'pdoc'
  126. kAEQuitApplication                EQU        'quit'
  127. kAEAnswer                        EQU        'ansr'
  128. kAEApplicationDied                EQU        'obit'
  129.  
  130. ; Constants for use in AESend mode 
  131. kAENoReply                        EQU        $00000001            ; sender doesn't want a reply to event 
  132. kAEQueueReply                    EQU        $00000002            ; sender wants a reply but won't wait 
  133. kAEWaitReply                    EQU        $00000003            ; sender wants a reply and will wait 
  134. kAENeverInteract                EQU        $00000010            ; server should not interact with user 
  135. kAECanInteract                    EQU        $00000020            ; server may try to interact with user 
  136. kAEAlwaysInteract                EQU        $00000030            ; server should always interact with user where appropriate 
  137. kAECanSwitchLayer                EQU        $00000040            ; interaction may switch layer 
  138. kAEDontReconnect                EQU        $00000080            ; don't reconnect if there is a sessClosedErr from PPCToolbox 
  139. kAEWantReceipt                    EQU        nReturnReceipt        ; sender wants a receipt of message 
  140. kAEDontRecord                    EQU        $00001000            ; don't record this event - available only in vers 1.0.1 and greater 
  141. kAEDontExecute                    EQU        $00002000            ; don't send the event for recording - available only in vers 1.0.1 and greater 
  142. ; Constants for the send priority in AESend 
  143. kAENormalPriority                EQU        $00000000            ; post message at the end of the event queue 
  144. kAEHighPriority                    EQU        nAttnMsg            ; post message at the front of the event queue 
  145.  
  146. ; Constants for recording 
  147. kAEStartRecording                EQU        'reca'                ; available only in vers 1.0.1 and greater 
  148. kAEStopRecording                EQU        'recc'                ; available only in vers 1.0.1 and greater 
  149. kAENotifyStartRecording            EQU        'rec1'                ; available only in vers 1.0.1 and greater 
  150. kAENotifyStopRecording            EQU        'rec0'                ; available only in vers 1.0.1 and greater 
  151. kAENotifyRecording                EQU        'recr'
  152.  
  153. ; Constant for the returnID param of AECreateAppleEvent 
  154. kAutoGenerateReturnID            EQU        -1                    ; AECreateAppleEvent will generate a session-unique ID 
  155. ; Constant for transaction ID’s 
  156. kAnyTransactionID                EQU        0                    ; no transaction is in use 
  157. ; Constants for timeout durations 
  158. kAEDefaultTimeout                EQU        -1                    ; timeout value determined by AEM 
  159. kNoTimeOut                        EQU        -2                    ; wait until reply comes back, however long it takes 
  160.  
  161. ; Constants for AEResumeTheCurrentEvent 
  162. kAENoDispatch                    EQU        0                    ; dispatch parameter to AEResumeTheCurrentEvent takes a pointer to a dispatch 
  163. kAEUseStandardDispatch            EQU        $FFFFFFFF            ; table, or one of these two constants 
  164. ; Constants for Refcon in AEResumeTheCurrentEvent with kAEUseStandardDispatch 
  165. kAEDoNotIgnoreHandler            EQU        $00000000
  166. kAEIgnoreAppPhacHandler            EQU        $00000001            ; available only in vers 1.0.1 and greater 
  167. kAEIgnoreAppEventHandler        EQU        $00000002            ; available only in vers 1.0.1 and greater 
  168. kAEIgnoreSysPhacHandler            EQU        $00000004            ; available only in vers 1.0.1 and greater 
  169. kAEIgnoreSysEventHandler        EQU        $00000008            ; available only in vers 1.0.1 and greater 
  170. kAEIngoreBuiltInEventHandler    EQU        $00000010            ; available only in vers 1.0.1 and greater 
  171. kAEDontDisposeOnResume            EQU        $80000000            ; available only in vers 1.0.1 and greater 
  172.  
  173. ; Apple event manager data types 
  174. ; typedef FourCharCode         AEEventClass
  175. ; typedef FourCharCode         AEEventID
  176. ; typedef FourCharCode         AEKeyword
  177. ; typedef ResType             DescType
  178. AEDesc                     RECORD    0
  179. descriptorType             ds.l   1        ; offset: $0 (0)
  180. dataHandle                 ds.l   1        ; offset: $4 (4)
  181. sizeof                     EQU *            ; size:   $8 (8)
  182.                         ENDR
  183.  
  184. ; typedef struct AEDesc     AEDesc
  185. AEKeyDesc                 RECORD    0
  186. descKey                     ds.l   1        ; offset: $0 (0)
  187. descContent                 ds     AEDesc    ; offset: $4 (4)
  188. sizeof                     EQU *            ; size:   $C (12)
  189.                         ENDR
  190.  
  191. ; typedef struct AEKeyDesc     AEKeyDesc
  192. ; an AEDesc which contains address data 
  193. ; typedef AEDesc             AEAddressDesc
  194. ; a list of AEDesc's is a special kind of AEDesc 
  195. ; typedef AEDesc             AEDescList
  196. ; AERecord is a list of keyworded AEDesc's 
  197. ; typedef AEDescList         AERecord
  198. ; an AERecord that contains an AppleEvent 
  199. ; typedef AERecord             AppleEvent
  200. ; typedef long                 AESendMode
  201. ; priority param of AESend 
  202. ; typedef short             AESendPriority
  203.  
  204. kAEInteractWithSelf                EQU        0
  205. kAEInteractWithLocal            EQU        1
  206. kAEInteractWithAll                EQU        2
  207.  
  208. ; typedef SInt8             AEInteractAllowed
  209.  
  210. kAEUnknownSource                EQU        0
  211. kAEDirectCall                    EQU        1
  212. kAESameProcess                    EQU        2
  213. kAELocalProcess                    EQU        3
  214. kAERemoteProcess                EQU        4
  215.  
  216. ; typedef SInt8             AEEventSource
  217.  
  218. kAEDataArray                    EQU        0
  219. kAEPackedArray                    EQU        1
  220. kAEHandleArray                    EQU        2
  221. kAEDescArray                    EQU        3
  222. kAEKeyDescArray                    EQU        4
  223.  
  224. ; typedef SInt8             AEArrayType
  225. AEArrayData             RECORD    0
  226. kAEDataArray             ds.w   1        ; offset: $0 (0)
  227.                          ORG 0
  228. kAEPackedArray             ds.b   1        ; offset: $0 (0)
  229.                          ORG 0
  230. kAEHandleArray             ds.l   1        ; offset: $0 (0)
  231.                          ORG 0
  232. kAEDescArray             ds     AEDesc    ; offset: $0 (0)
  233.                          ORG 0
  234. kAEKeyDescArray             ds     AEKeyDesc ; offset: $0 (0)
  235.                          ORG 12
  236. sizeof                     EQU *            ; size:   $C (12)
  237.                         ENDR
  238.  
  239. ; typedef union AEArrayData  AEArrayData
  240. ; typedef AEArrayData         *AEArrayDataPointer
  241. ; typedef UniversalProcPtr     AECoercionHandlerUPP
  242. ;*************************************************************************
  243. ; The following calls apply to any AEDesc. Every 'result' descriptor is
  244. ; created for you, so you will be responsible for memory management
  245. ; (including disposing) of the descriptors so created. Note: purgeable
  246. ; descriptor data is not supported - the AEM does not call LoadResource.  
  247. ;*************************************************************************
  248. ;
  249. ; pascal OSErr AECreateDesc(DescType typeCode, const void *dataPtr, Size dataSize, AEDesc *result)
  250. ;
  251.     IF ¬ GENERATINGCFM THEN
  252.         Macro
  253.         _AECreateDesc
  254.             move.w    #$0825,d0
  255.             dc.w     $A816
  256.         EndM
  257.     ELSE
  258.         IMPORT_CFM_FUNCTION    AECreateDesc
  259.     ENDIF
  260.  
  261. ;
  262. ; pascal OSErr AECoercePtr(DescType typeCode, const void *dataPtr, Size dataSize, DescType toType, AEDesc *result)
  263. ;
  264.     IF ¬ GENERATINGCFM THEN
  265.         Macro
  266.         _AECoercePtr
  267.             move.w    #$0A02,d0
  268.             dc.w     $A816
  269.         EndM
  270.     ELSE
  271.         IMPORT_CFM_FUNCTION    AECoercePtr
  272.     ENDIF
  273.  
  274. ;
  275. ; pascal OSErr AECoerceDesc(const AEDesc *theAEDesc, DescType toType, AEDesc *result)
  276. ;
  277.     IF ¬ GENERATINGCFM THEN
  278.         Macro
  279.         _AECoerceDesc
  280.             move.w    #$0603,d0
  281.             dc.w     $A816
  282.         EndM
  283.     ELSE
  284.         IMPORT_CFM_FUNCTION    AECoerceDesc
  285.     ENDIF
  286.  
  287. ;
  288. ; pascal OSErr AEDisposeDesc(AEDesc *theAEDesc)
  289. ;
  290.     IF ¬ GENERATINGCFM THEN
  291.         Macro
  292.         _AEDisposeDesc
  293.             move.w    #$0204,d0
  294.             dc.w     $A816
  295.         EndM
  296.     ELSE
  297.         IMPORT_CFM_FUNCTION    AEDisposeDesc
  298.     ENDIF
  299.  
  300. ;
  301. ; pascal OSErr AEDuplicateDesc(const AEDesc *theAEDesc, AEDesc *result)
  302. ;
  303.     IF ¬ GENERATINGCFM THEN
  304.         Macro
  305.         _AEDuplicateDesc
  306.             move.w    #$0405,d0
  307.             dc.w     $A816
  308.         EndM
  309.     ELSE
  310.         IMPORT_CFM_FUNCTION    AEDuplicateDesc
  311.     ENDIF
  312.  
  313. ;*************************************************************************
  314. ;  The following calls apply to AEDescList. Since AEDescList is a subtype of
  315. ;  AEDesc, the calls in the previous section can also be used for AEDescList.
  316. ;  All list and array indices are 1-based. If the data was greater than
  317. ;  maximumSize in the routines below, then actualSize will be greater than
  318. ;  maximumSize, but only maximumSize bytes will actually be retrieved.
  319. ;*************************************************************************
  320. ;
  321. ; pascal OSErr AECreateList(const void *factoringPtr, Size factoredSize, Boolean isRecord, AEDescList *resultList)
  322. ;
  323.     IF ¬ GENERATINGCFM THEN
  324.         Macro
  325.         _AECreateList
  326.             move.w    #$0706,d0
  327.             dc.w     $A816
  328.         EndM
  329.     ELSE
  330.         IMPORT_CFM_FUNCTION    AECreateList
  331.     ENDIF
  332.  
  333. ;
  334. ; pascal OSErr AECountItems(const AEDescList *theAEDescList, long *theCount)
  335. ;
  336.     IF ¬ GENERATINGCFM THEN
  337.         Macro
  338.         _AECountItems
  339.             move.w    #$0407,d0
  340.             dc.w     $A816
  341.         EndM
  342.     ELSE
  343.         IMPORT_CFM_FUNCTION    AECountItems
  344.     ENDIF
  345.  
  346. ;
  347. ; pascal OSErr AEPutPtr(AEDescList *theAEDescList, long index, DescType typeCode, const void *dataPtr, Size dataSize)
  348. ;
  349.     IF ¬ GENERATINGCFM THEN
  350.         Macro
  351.         _AEPutPtr
  352.             move.w    #$0A08,d0
  353.             dc.w     $A816
  354.         EndM
  355.     ELSE
  356.         IMPORT_CFM_FUNCTION    AEPutPtr
  357.     ENDIF
  358.  
  359. ;
  360. ; pascal OSErr AEPutDesc(AEDescList *theAEDescList, long index, const AEDesc *theAEDesc)
  361. ;
  362.     IF ¬ GENERATINGCFM THEN
  363.         Macro
  364.         _AEPutDesc
  365.             move.w    #$0609,d0
  366.             dc.w     $A816
  367.         EndM
  368.     ELSE
  369.         IMPORT_CFM_FUNCTION    AEPutDesc
  370.     ENDIF
  371.  
  372. ;
  373. ; pascal OSErr AEGetNthPtr(const AEDescList *theAEDescList, long index, DescType desiredType, AEKeyword *theAEKeyword, DescType *typeCode, void *dataPtr, Size maximumSize, Size *actualSize)
  374. ;
  375.     IF ¬ GENERATINGCFM THEN
  376.         Macro
  377.         _AEGetNthPtr
  378.             move.w    #$100A,d0
  379.             dc.w     $A816
  380.         EndM
  381.     ELSE
  382.         IMPORT_CFM_FUNCTION    AEGetNthPtr
  383.     ENDIF
  384.  
  385. ;
  386. ; pascal OSErr AEGetNthDesc(const AEDescList *theAEDescList, long index, DescType desiredType, AEKeyword *theAEKeyword, AEDesc *result)
  387. ;
  388.     IF ¬ GENERATINGCFM THEN
  389.         Macro
  390.         _AEGetNthDesc
  391.             move.w    #$0A0B,d0
  392.             dc.w     $A816
  393.         EndM
  394.     ELSE
  395.         IMPORT_CFM_FUNCTION    AEGetNthDesc
  396.     ENDIF
  397.  
  398. ;
  399. ; pascal OSErr AESizeOfNthItem(const AEDescList *theAEDescList, long index, DescType *typeCode, Size *dataSize)
  400. ;
  401.     IF ¬ GENERATINGCFM THEN
  402.         Macro
  403.         _AESizeOfNthItem
  404.             move.w    #$082A,d0
  405.             dc.w     $A816
  406.         EndM
  407.     ELSE
  408.         IMPORT_CFM_FUNCTION    AESizeOfNthItem
  409.     ENDIF
  410.  
  411. ;
  412. ; pascal OSErr AEGetArray(const AEDescList *theAEDescList, AEArrayType arrayType, AEArrayDataPointer arrayPtr, Size maximumSize, DescType *itemType, Size *itemSize, long *itemCount)
  413. ;
  414.     IF ¬ GENERATINGCFM THEN
  415.         Macro
  416.         _AEGetArray
  417.             move.w    #$0D0C,d0
  418.             dc.w     $A816
  419.         EndM
  420.     ELSE
  421.         IMPORT_CFM_FUNCTION    AEGetArray
  422.     ENDIF
  423.  
  424. ;
  425. ; pascal OSErr AEPutArray(AEDescList *theAEDescList, AEArrayType arrayType, const AEArrayData *arrayPtr, DescType itemType, Size itemSize, long itemCount)
  426. ;
  427.     IF ¬ GENERATINGCFM THEN
  428.         Macro
  429.         _AEPutArray
  430.             move.w    #$0B0D,d0
  431.             dc.w     $A816
  432.         EndM
  433.     ELSE
  434.         IMPORT_CFM_FUNCTION    AEPutArray
  435.     ENDIF
  436.  
  437. ;
  438. ; pascal OSErr AEDeleteItem(AEDescList *theAEDescList, long index)
  439. ;
  440.     IF ¬ GENERATINGCFM THEN
  441.         Macro
  442.         _AEDeleteItem
  443.             move.w    #$040E,d0
  444.             dc.w     $A816
  445.         EndM
  446.     ELSE
  447.         IMPORT_CFM_FUNCTION    AEDeleteItem
  448.     ENDIF
  449.  
  450. ;*************************************************************************
  451. ; The following calls apply to AERecord. Since AERecord is a subtype of
  452. ; AEDescList, the calls in the previous sections can also be used for
  453. ; AERecord an AERecord can be created by using AECreateList with isRecord
  454. ; set to true. 
  455. ;*************************************************************************
  456. ;*************************************************************************
  457. ;  The following calls are used to pack and unpack parameters from records
  458. ;  of type AppleEvent. Since AppleEvent is a subtype of AERecord, the calls
  459. ;  in the previous sections can also be used for variables of type
  460. ;  AppleEvent. The next six calls are in fact identical to the six calls
  461. ;  for AERecord.
  462. ;*************************************************************************
  463. ;
  464. ; pascal OSErr AEPutParamPtr(AppleEvent *theAppleEvent, AEKeyword theAEKeyword, DescType typeCode, const void *dataPtr, Size dataSize)
  465. ;
  466.     IF ¬ GENERATINGCFM THEN
  467.         Macro
  468.         _AEPutParamPtr
  469.             move.w    #$0A0F,d0
  470.             dc.w     $A816
  471.         EndM
  472.     ELSE
  473.         IMPORT_CFM_FUNCTION    AEPutParamPtr
  474.     ENDIF
  475.  
  476. ;
  477. ; pascal OSErr AEPutParamDesc(AppleEvent *theAppleEvent, AEKeyword theAEKeyword, const AEDesc *theAEDesc)
  478. ;
  479.     IF ¬ GENERATINGCFM THEN
  480.         Macro
  481.         _AEPutParamDesc
  482.             move.w    #$0610,d0
  483.             dc.w     $A816
  484.         EndM
  485.     ELSE
  486.         IMPORT_CFM_FUNCTION    AEPutParamDesc
  487.     ENDIF
  488.  
  489. ;
  490. ; pascal OSErr AEGetParamPtr(const AppleEvent *theAppleEvent, AEKeyword theAEKeyword, DescType desiredType, DescType *typeCode, void *dataPtr, Size maximumSize, Size *actualSize)
  491. ;
  492.     IF ¬ GENERATINGCFM THEN
  493.         Macro
  494.         _AEGetParamPtr
  495.             move.w    #$0E11,d0
  496.             dc.w     $A816
  497.         EndM
  498.     ELSE
  499.         IMPORT_CFM_FUNCTION    AEGetParamPtr
  500.     ENDIF
  501.  
  502. ;
  503. ; pascal OSErr AEGetParamDesc(const AppleEvent *theAppleEvent, AEKeyword theAEKeyword, DescType desiredType, AEDesc *result)
  504. ;
  505.     IF ¬ GENERATINGCFM THEN
  506.         Macro
  507.         _AEGetParamDesc
  508.             move.w    #$0812,d0
  509.             dc.w     $A816
  510.         EndM
  511.     ELSE
  512.         IMPORT_CFM_FUNCTION    AEGetParamDesc
  513.     ENDIF
  514.  
  515. ;
  516. ; pascal OSErr AESizeOfParam(const AppleEvent *theAppleEvent, AEKeyword theAEKeyword, DescType *typeCode, Size *dataSize)
  517. ;
  518.     IF ¬ GENERATINGCFM THEN
  519.         Macro
  520.         _AESizeOfParam
  521.             move.w    #$0829,d0
  522.             dc.w     $A816
  523.         EndM
  524.     ELSE
  525.         IMPORT_CFM_FUNCTION    AESizeOfParam
  526.     ENDIF
  527.  
  528. ;
  529. ; pascal OSErr AEDeleteParam(AppleEvent *theAppleEvent, AEKeyword theAEKeyword)
  530. ;
  531.     IF ¬ GENERATINGCFM THEN
  532.         Macro
  533.         _AEDeleteParam
  534.             move.w    #$0413,d0
  535.             dc.w     $A816
  536.         EndM
  537.     ELSE
  538.         IMPORT_CFM_FUNCTION    AEDeleteParam
  539.     ENDIF
  540.  
  541. ;*************************************************************************
  542. ; The following calls also apply to type AppleEvent. Message attributes are
  543. ; far more restricted, and can only be accessed through the following 5
  544. ; calls. The various list and record routines cannot be used to access the
  545. ; attributes of an event. 
  546. ;*************************************************************************
  547. ;
  548. ; pascal OSErr AEGetAttributePtr(const AppleEvent *theAppleEvent, AEKeyword theAEKeyword, DescType desiredType, DescType *typeCode, void *dataPtr, Size maximumSize, Size *actualSize)
  549. ;
  550.     IF ¬ GENERATINGCFM THEN
  551.         Macro
  552.         _AEGetAttributePtr
  553.             move.w    #$0E15,d0
  554.             dc.w     $A816
  555.         EndM
  556.     ELSE
  557.         IMPORT_CFM_FUNCTION    AEGetAttributePtr
  558.     ENDIF
  559.  
  560. ;
  561. ; pascal OSErr AEGetAttributeDesc(const AppleEvent *theAppleEvent, AEKeyword theAEKeyword, DescType desiredType, AEDesc *result)
  562. ;
  563.     IF ¬ GENERATINGCFM THEN
  564.         Macro
  565.         _AEGetAttributeDesc
  566.             move.w    #$0826,d0
  567.             dc.w     $A816
  568.         EndM
  569.     ELSE
  570.         IMPORT_CFM_FUNCTION    AEGetAttributeDesc
  571.     ENDIF
  572.  
  573. ;
  574. ; pascal OSErr AESizeOfAttribute(const AppleEvent *theAppleEvent, AEKeyword theAEKeyword, DescType *typeCode, Size *dataSize)
  575. ;
  576.     IF ¬ GENERATINGCFM THEN
  577.         Macro
  578.         _AESizeOfAttribute
  579.             move.w    #$0828,d0
  580.             dc.w     $A816
  581.         EndM
  582.     ELSE
  583.         IMPORT_CFM_FUNCTION    AESizeOfAttribute
  584.     ENDIF
  585.  
  586. ;
  587. ; pascal OSErr AEPutAttributePtr(AppleEvent *theAppleEvent, AEKeyword theAEKeyword, DescType typeCode, const void *dataPtr, Size dataSize)
  588. ;
  589.     IF ¬ GENERATINGCFM THEN
  590.         Macro
  591.         _AEPutAttributePtr
  592.             move.w    #$0A16,d0
  593.             dc.w     $A816
  594.         EndM
  595.     ELSE
  596.         IMPORT_CFM_FUNCTION    AEPutAttributePtr
  597.     ENDIF
  598.  
  599. ;
  600. ; pascal OSErr AEPutAttributeDesc(AppleEvent *theAppleEvent, AEKeyword theAEKeyword, const AEDesc *theAEDesc)
  601. ;
  602.     IF ¬ GENERATINGCFM THEN
  603.         Macro
  604.         _AEPutAttributeDesc
  605.             move.w    #$0627,d0
  606.             dc.w     $A816
  607.         EndM
  608.     ELSE
  609.         IMPORT_CFM_FUNCTION    AEPutAttributeDesc
  610.     ENDIF
  611.  
  612. ;*************************************************************************
  613. ;  The next couple of calls are basic routines used to create, send,
  614. ;  and process AppleEvents. 
  615. ;*************************************************************************
  616. ;
  617. ; pascal OSErr AECreateAppleEvent(AEEventClass theAEEventClass, AEEventID theAEEventID, const AEAddressDesc *target, short returnID, long transactionID, AppleEvent *result)
  618. ;
  619.     IF ¬ GENERATINGCFM THEN
  620.         Macro
  621.         _AECreateAppleEvent
  622.             move.w    #$0B14,d0
  623.             dc.w     $A816
  624.         EndM
  625.     ELSE
  626.         IMPORT_CFM_FUNCTION    AECreateAppleEvent
  627.     ENDIF
  628.  
  629. ;
  630. ; pascal OSErr AESend(const AppleEvent *theAppleEvent, AppleEvent *reply, AESendMode sendMode, AESendPriority sendPriority, long timeOutInTicks, AEIdleUPP idleProc, AEFilterUPP filterProc)
  631. ;
  632.     IF ¬ GENERATINGCFM THEN
  633.         Macro
  634.         _AESend
  635.             move.w    #$0D17,d0
  636.             dc.w     $A816
  637.         EndM
  638.     ELSE
  639.         IMPORT_CFM_FUNCTION    AESend
  640.     ENDIF
  641.  
  642. ;
  643. ; pascal OSErr AEProcessAppleEvent(const EventRecord *theEventRecord)
  644. ;
  645.     IF ¬ GENERATINGCFM THEN
  646.         Macro
  647.         _AEProcessAppleEvent
  648.             move.w    #$021B,d0
  649.             dc.w     $A816
  650.         EndM
  651.     ELSE
  652.         IMPORT_CFM_FUNCTION    AEProcessAppleEvent
  653.     ENDIF
  654.  
  655. ; Note: during event processing, an event handler may realize that it is likely
  656. ; to exceed the client's timeout limit. Passing the reply to this
  657. ; routine causes a wait event to be generated that asks the client
  658. ; for more time. 
  659. ;
  660. ;
  661. ; pascal OSErr AEResetTimer(const AppleEvent *reply)
  662. ;
  663.     IF ¬ GENERATINGCFM THEN
  664.         Macro
  665.         _AEResetTimer
  666.             move.w    #$0219,d0
  667.             dc.w     $A816
  668.         EndM
  669.     ELSE
  670.         IMPORT_CFM_FUNCTION    AEResetTimer
  671.     ENDIF
  672.  
  673. ;*************************************************************************
  674. ; The following four calls are available for applications which need more
  675. ; sophisticated control over when and how events are processed. Applications
  676. ; which implement multi-session servers or which implement their own
  677. ; internal event queueing will probably be the major clients of these
  678. ; routines. They can be called from within a handler to prevent the AEM from
  679. ; disposing of the AppleEvent when the handler returns. They can be used to
  680. ; asynchronously process the event (as MacApp does).
  681. ;*************************************************************************
  682. ;
  683. ; pascal OSErr AESuspendTheCurrentEvent(const AppleEvent *theAppleEvent)
  684. ;
  685.     IF ¬ GENERATINGCFM THEN
  686.         Macro
  687.         _AESuspendTheCurrentEvent
  688.             move.w    #$022B,d0
  689.             dc.w     $A816
  690.         EndM
  691.     ELSE
  692.         IMPORT_CFM_FUNCTION    AESuspendTheCurrentEvent
  693.     ENDIF
  694.  
  695. ; Note: The following routine tells the AppleEvent manager that processing
  696. ; is either about to resume or has been completed on a previously suspended
  697. ; event. The procPtr passed in as the dispatcher parameter will be called to
  698. ; attempt to redispatch the event. Several constants for the dispatcher
  699. ; parameter allow special behavior. They are:
  700. ;      - kAEUseStandardDispatch means redispatch as if the event was just
  701. ;      received, using the standard AppleEvent dispatch mechanism.
  702. ;      - kAENoDispatch means ignore the parameter.
  703. ;         Use this in the case where the event has been handled and no
  704. ;      redispatch is needed.
  705. ;      - non nil means call the routine which the dispatcher points to.
  706. ;
  707. ;
  708. ; pascal OSErr AEResumeTheCurrentEvent(const AppleEvent *theAppleEvent, const AppleEvent *reply, AEEventHandlerUPP dispatcher, long handlerRefcon)
  709. ;
  710.     IF ¬ GENERATINGCFM THEN
  711.         Macro
  712.         _AEResumeTheCurrentEvent
  713.             move.w    #$0818,d0
  714.             dc.w     $A816
  715.         EndM
  716.     ELSE
  717.         IMPORT_CFM_FUNCTION    AEResumeTheCurrentEvent
  718.     ENDIF
  719.  
  720. ;
  721. ; pascal OSErr AEGetTheCurrentEvent(AppleEvent *theAppleEvent)
  722. ;
  723.     IF ¬ GENERATINGCFM THEN
  724.         Macro
  725.         _AEGetTheCurrentEvent
  726.             move.w    #$021A,d0
  727.             dc.w     $A816
  728.         EndM
  729.     ELSE
  730.         IMPORT_CFM_FUNCTION    AEGetTheCurrentEvent
  731.     ENDIF
  732.  
  733. ;
  734. ; pascal OSErr AESetTheCurrentEvent(const AppleEvent *theAppleEvent)
  735. ;
  736.     IF ¬ GENERATINGCFM THEN
  737.         Macro
  738.         _AESetTheCurrentEvent
  739.             move.w    #$022C,d0
  740.             dc.w     $A816
  741.         EndM
  742.     ELSE
  743.         IMPORT_CFM_FUNCTION    AESetTheCurrentEvent
  744.     ENDIF
  745.  
  746. ;*************************************************************************
  747. ;  The following three calls are used to allow applications to behave
  748. ;  courteously when a user interaction such as a dialog box is needed. 
  749. ;*************************************************************************
  750. ;
  751. ; pascal OSErr AEGetInteractionAllowed(AEInteractAllowed *level)
  752. ;
  753.     IF ¬ GENERATINGCFM THEN
  754.         Macro
  755.         _AEGetInteractionAllowed
  756.             move.w    #$021D,d0
  757.             dc.w     $A816
  758.         EndM
  759.     ELSE
  760.         IMPORT_CFM_FUNCTION    AEGetInteractionAllowed
  761.     ENDIF
  762.  
  763. ;
  764. ; pascal OSErr AESetInteractionAllowed(AEInteractAllowed level)
  765. ;
  766.     IF ¬ GENERATINGCFM THEN
  767.         Macro
  768.         _AESetInteractionAllowed
  769.             move.w    #$011E,d0
  770.             dc.w     $A816
  771.         EndM
  772.     ELSE
  773.         IMPORT_CFM_FUNCTION    AESetInteractionAllowed
  774.     ENDIF
  775.  
  776. ;
  777. ; pascal OSErr AEInteractWithUser(long timeOutInTicks, NMRecPtr nmReqPtr, AEIdleUPP idleProc)
  778. ;
  779.     IF ¬ GENERATINGCFM THEN
  780.         Macro
  781.         _AEInteractWithUser
  782.             move.w    #$061C,d0
  783.             dc.w     $A816
  784.         EndM
  785.     ELSE
  786.         IMPORT_CFM_FUNCTION    AEInteractWithUser
  787.     ENDIF
  788.  
  789. ;*************************************************************************
  790. ;  These calls are used to set up and modify the event dispatch table.
  791. ;*************************************************************************
  792. ;
  793. ; pascal OSErr AEInstallEventHandler(AEEventClass theAEEventClass, AEEventID theAEEventID, AEEventHandlerUPP handler, long handlerRefcon, Boolean isSysHandler)
  794. ;
  795.     IF ¬ GENERATINGCFM THEN
  796.         Macro
  797.         _AEInstallEventHandler
  798.             move.w    #$091F,d0
  799.             dc.w     $A816
  800.         EndM
  801.     ELSE
  802.         IMPORT_CFM_FUNCTION    AEInstallEventHandler
  803.     ENDIF
  804.  
  805. ;
  806. ; pascal OSErr AERemoveEventHandler(AEEventClass theAEEventClass, AEEventID theAEEventID, AEEventHandlerUPP handler, Boolean isSysHandler)
  807. ;
  808.     IF ¬ GENERATINGCFM THEN
  809.         Macro
  810.         _AERemoveEventHandler
  811.             move.w    #$0720,d0
  812.             dc.w     $A816
  813.         EndM
  814.     ELSE
  815.         IMPORT_CFM_FUNCTION    AERemoveEventHandler
  816.     ENDIF
  817.  
  818. ;
  819. ; pascal OSErr AEGetEventHandler(AEEventClass theAEEventClass, AEEventID theAEEventID, AEEventHandlerUPP *handler, long *handlerRefcon, Boolean isSysHandler)
  820. ;
  821.     IF ¬ GENERATINGCFM THEN
  822.         Macro
  823.         _AEGetEventHandler
  824.             move.w    #$0921,d0
  825.             dc.w     $A816
  826.         EndM
  827.     ELSE
  828.         IMPORT_CFM_FUNCTION    AEGetEventHandler
  829.     ENDIF
  830.  
  831. ;*************************************************************************
  832. ;  These calls are used to set up and modify the coercion dispatch table.
  833. ;*************************************************************************
  834. ;
  835. ; pascal OSErr AEInstallCoercionHandler(DescType fromType, DescType toType, AECoercionHandlerUPP handler, long handlerRefcon, Boolean fromTypeIsDesc, Boolean isSysHandler)
  836. ;
  837.     IF ¬ GENERATINGCFM THEN
  838.         Macro
  839.         _AEInstallCoercionHandler
  840.             move.w    #$0A22,d0
  841.             dc.w     $A816
  842.         EndM
  843.     ELSE
  844.         IMPORT_CFM_FUNCTION    AEInstallCoercionHandler
  845.     ENDIF
  846.  
  847. ;
  848. ; pascal OSErr AERemoveCoercionHandler(DescType fromType, DescType toType, AECoercionHandlerUPP handler, Boolean isSysHandler)
  849. ;
  850.     IF ¬ GENERATINGCFM THEN
  851.         Macro
  852.         _AERemoveCoercionHandler
  853.             move.w    #$0723,d0
  854.             dc.w     $A816
  855.         EndM
  856.     ELSE
  857.         IMPORT_CFM_FUNCTION    AERemoveCoercionHandler
  858.     ENDIF
  859.  
  860. ;
  861. ; pascal OSErr AEGetCoercionHandler(DescType fromType, DescType toType, AECoercionHandlerUPP *handler, long *handlerRefcon, Boolean *fromTypeIsDesc, Boolean isSysHandler)
  862. ;
  863.     IF ¬ GENERATINGCFM THEN
  864.         Macro
  865.         _AEGetCoercionHandler
  866.             move.w    #$0B24,d0
  867.             dc.w     $A816
  868.         EndM
  869.     ELSE
  870.         IMPORT_CFM_FUNCTION    AEGetCoercionHandler
  871.     ENDIF
  872.  
  873. ;*************************************************************************
  874. ;  These calls are used to set up and modify special hooks into the
  875. ;  AppleEvent manager.
  876. ;*************************************************************************
  877. ;
  878. ; pascal OSErr AEInstallSpecialHandler(AEKeyword functionClass, UniversalProcPtr handler, Boolean isSysHandler)
  879. ;
  880.     IF ¬ GENERATINGCFM THEN
  881.         Macro
  882.         _AEInstallSpecialHandler
  883.             move.w    #$0500,d0
  884.             dc.w     $A816
  885.         EndM
  886.     ELSE
  887.         IMPORT_CFM_FUNCTION    AEInstallSpecialHandler
  888.     ENDIF
  889.  
  890. ;
  891. ; pascal OSErr AERemoveSpecialHandler(AEKeyword functionClass, UniversalProcPtr handler, Boolean isSysHandler)
  892. ;
  893.     IF ¬ GENERATINGCFM THEN
  894.         Macro
  895.         _AERemoveSpecialHandler
  896.             move.w    #$0501,d0
  897.             dc.w     $A816
  898.         EndM
  899.     ELSE
  900.         IMPORT_CFM_FUNCTION    AERemoveSpecialHandler
  901.     ENDIF
  902.  
  903. ;
  904. ; pascal OSErr AEGetSpecialHandler(AEKeyword functionClass, UniversalProcPtr *handler, Boolean isSysHandler)
  905. ;
  906.     IF ¬ GENERATINGCFM THEN
  907.         Macro
  908.         _AEGetSpecialHandler
  909.             move.w    #$052D,d0
  910.             dc.w     $A816
  911.         EndM
  912.     ELSE
  913.         IMPORT_CFM_FUNCTION    AEGetSpecialHandler
  914.     ENDIF
  915.  
  916. ;*************************************************************************
  917. ;  This call was added in version 1.0.1. If called with the keyword
  918. ;  keyAERecorderCount ('recr'), the number of recorders that are
  919. ;  currently active is returned in 'result'.
  920. ;*************************************************************************
  921. ; available only in vers 1.0.1 and greater 
  922. ;
  923. ; pascal OSErr AEManagerInfo(AEKeyword keyWord, long *result)
  924. ;
  925.     IF ¬ GENERATINGCFM THEN
  926.         Macro
  927.         _AEManagerInfo
  928.             move.w    #$0441,d0
  929.             dc.w     $A816
  930.         EndM
  931.     ELSE
  932.         IMPORT_CFM_FUNCTION    AEManagerInfo
  933.     ENDIF
  934.  
  935.     ENDIF ; __APPLEEVENTS__
  936.